﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BMS.IRepository
{
    public interface IBaseRepository<T> where T : class
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体信息</param>
        public Task Insert(T entity);
        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="entities">实体信息集合</param>
        public Task InsertBatch(List<T> entities);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">实体信息</param>
        public Task Update(T entity);
        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="entities">实体信息集合</param>
        public Task UpdateBatch(List<T> entities);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity">实体信息</param>
        public Task Delete(T entity);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="entities">实体信息结合</param>
        public Task DeleteBatch(List<T> entities);
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public Task<IQueryable<T>> GetAll();
    }
}
